package com.oig.auth.api.factory;

import com.oig.auth.api.UserService;
import com.oig.auth.api.fallback.UserServiceFallbackImpl;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserFallbackFactory implements FallbackFactory<UserService> {

    @Override
    public UserService create(Throwable cause) {
        UserServiceFallbackImpl userServiceFallBack = new UserServiceFallbackImpl();
        userServiceFallBack.setCause(cause);
        return userServiceFallBack;
    }


}
